Inscoper::XMLNode¶
XMLNode class represents a node in an XML document. More...
#include <XMLNode.h>
Public Functions¶
| Name | |
|---|---|
| XMLNode() Default constructor. |
|
| XMLNode(XMLNode const & node) Copy constructor. |
|
| XMLNode(XMLNode && node) Move constructor. |
|
| XMLNode & | operator=(XMLNode const & node) Copy assignment operator. |
| XMLNode & | operator=(XMLNode && node) Move assignment operator. |
| ~XMLNode() Destructor. |
|
| XMLNode | addChild(std::string childName ="") Add a child node. |
| void | removeChild(std::string childName) Remove a child node. |
| XMLNode | getChild(const std::string & name) Get a child node. |
| std::vector< XMLNode > | getChildren(const std::string & name) Get all children with a specific name. |
| std::vector< XMLNode > | getChildren() Get all children. |
| void | setName(const std::string & name) Set the node name. |
| std::string | getName() Get the node name. |
| bool | isEmpty() Check if node is empty. |
| void | addAttribute(const std::string & name, const std::string & value) Add a string attribute. |
| void | addAttribute(const std::string & name, const bool value) Add a boolean attribute. |
| void | addAttribute(const std::string & name, const unsigned int value) Add an unsigned int attribute. |
| void | addAttribute(const std::string & name, const unsigned short value) Add an unsigned short attribute. |
| void | addAttribute(const std::string & name, unsigned char value) Add an unsigned char attribute. |
| void | addAttribute(const std::string & name, char value) Add a char attribute. |
| void | addAttribute(const std::string & name, double value) Add a double attribute. |
| Inscoper::XMLAttribute | getAttribute(const std::string & name) Get an attribute. |
| std::vector< Inscoper::XMLAttribute > | getAttributes() Get all attributes. |
Friends¶
| Name | |
|---|---|
| class | XMLDocument |
Detailed Description¶
XMLNode class represents a node in an XML document.
This class allows tree traversal, manipulation, and access to attributes and children of an XML element.
Public Functions Documentation¶
function XMLNode¶
Default constructor.
function XMLNode¶
Copy constructor.
Parameters:
- node : The XMLNode to copy
function XMLNode¶
Move constructor.
Parameters:
- node : The XMLNode to move
function operator=¶
Copy assignment operator.
Parameters:
- node : The XMLNode to copy
Return: Reference to this XMLNode
function operator=¶
Move assignment operator.
Parameters:
- node : The XMLNode to move
Return: Reference to this XMLNode
function ~XMLNode¶
Destructor.
function addChild¶
Add a child node.
Parameters:
- childName : The name of the child node
Return: The created child XML node
Creates and returns a child node with a specified name.
function removeChild¶
Remove a child node.
Parameters:
- childName : The name of the child node to remove
Removes the first child node matching the specified name.
function getChild¶
Get a child node.
Parameters:
- name : The name of the child node
Return: The child XML node
Retrieves the first child node with the specified name.
function getChildren¶
Get all children with a specific name.
Parameters:
- name : The name of the child nodes
Return: The list of matching XML nodes
Retrieves all child nodes matching the specified name.
function getChildren¶
Get all children.
Return: The list of all child XML nodes
Retrieves all child nodes of this node.
function setName¶
Set the node name.
Parameters:
- name : The name for the node
Sets the name of this XML node.
function getName¶
Get the node name.
Return: The name of the node
Retrieves the name of this XML node.
function isEmpty¶
Check if node is empty.
Return: True if the node is empty, false otherwise
Check if the node is empty.
function addAttribute¶
Add a string attribute.
Parameters:
- name : The name of the attribute
- value : The string value of the attribute
Adds a string attribute to the node.
function addAttribute¶
Add a boolean attribute.
Parameters:
- name : The name of the attribute
- value : The boolean value of the attribute
Adds a boolean attribute to the node.
function addAttribute¶
Add an unsigned int attribute.
Parameters:
- name : The name of the attribute
- value : The unsigned int value of the attribute
Adds an unsigned int attribute to the node.
function addAttribute¶
Add an unsigned short attribute.
Parameters:
- name : The name of the attribute
- value : The unsigned short value of the attribute
Adds an unsigned short attribute to the node.
function addAttribute¶
Add an unsigned char attribute.
Parameters:
- name : The name of the attribute
- value : The unsigned char value of the attribute
Adds an unsigned char attribute to the node.
function addAttribute¶
Add a char attribute.
Parameters:
- name : The name of the attribute
- value : The char value of the attribute
Adds a char attribute to the node.
function addAttribute¶
Add a double attribute.
Parameters:
- name : The name of the attribute
- value : The double value of the attribute
Adds a double attribute to the node.
function getAttribute¶
Get an attribute.
Parameters:
- name : The name of the attribute
Return: The XML attribute
Retrieves the attribute with the specified name.
function getAttributes¶
Get all attributes.
Return: The list of XML attributes
Retrieves all attributes of this node.
Friends¶
friend XMLDocument¶
Updated on 2026-04-02 at 10:55:36 +0200